#include<functional>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<unistd.h>
#include<arpa/inet.h>
#include<netinet/in.h>

#include<thread>
#include<chrono>

#include<pthread.h>

#include"timer.h"
#include"sender.h"
#include"receiver.h"

using namespace std;

#define BUFF_LINE 512
#define BUFF_LINE_2 1024




/***************************************
		   Function Main	
***************************************/

int main(int argc, char **argv)
{
	SenderThread senderThread;

	SenderController senderController;
	senderController.sender_install( &senderThread.sender );

	TimerThread timeThread_sender(chrono::seconds(20), senderController.sender_stop_sender);

	timeThread_sender.run_independent_timer();
	senderThread.run_independent_sender();

	timeThread_sender.wait_for_timer();
	senderThread.wait_for_sender();

	return 0;
}

